package org.suyafei.utils;

import org.springframework.beans.BeanUtils;

/**
 * @author 宿某人
 * @Date: 2022/02/05/8:25 下午
 * @Description:
 */
public class BeanUtil {

    public static  <T> T beanProcess(Object resource, Class<T> target) {
        try {
            T o = target.newInstance();
            BeanUtils.copyProperties(resource, o);
            return o;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}